From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0394.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0394.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0394.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0394.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0394.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0394.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0394.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0394.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0370.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0394.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0394.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0394.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0394.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0394.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0394.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0395.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0395.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0395.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0395.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0395.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0395.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0395.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0395.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0371.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0395.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0395.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0395.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0395.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0395.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0395.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0396.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0396.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0396.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0396.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0396.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0396.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0396.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0396.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0372.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0396.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0396.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0396.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0396.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0396.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0396.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0397.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0397.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0397.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0397.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0397.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0397.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0397.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0397.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0373.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0397.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0397.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0397.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0397.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0397.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0397.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0398.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0398.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0398.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0398.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0398.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0398.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0398.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0398.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0377.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0398.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0398.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0398.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0398.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0398.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0398.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0399.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0399.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0399.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0399.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0399.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0399.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0399.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0399.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0378.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0399.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0399.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0399.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0399.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0399.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0399.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0400.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0400.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0400.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0400.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0400.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0400.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0400.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0400.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0379.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0400.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0400.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0400.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0400.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0400.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0400.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0401.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0401.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0401.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0401.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0401.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0401.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0401.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0401.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0380.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0401.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0401.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0401.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0401.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0401.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0401.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0402.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0402.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0402.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0402.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0402.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0402.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0402.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0402.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0384.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0402.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0402.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0402.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0402.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0402.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0402.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0403.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0403.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0403.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0403.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0403.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0403.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0403.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0403.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0386.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0403.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0403.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0403.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0403.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0403.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0403.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0001.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0001.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0001.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0001.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0001.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0001.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0001.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0001.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0001.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0001.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0001.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0001.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0001.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0001.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0001.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0002.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0002.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0002.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0002.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0002.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0002.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0002.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0002.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0002.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0002.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0002.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0002.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0002.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0002.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0002.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0003.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0003.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0003.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0003.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0003.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0003.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0003.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0003.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0003.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0003.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0003.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0003.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0003.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0003.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0003.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0004.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0004.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0004.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0004.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0004.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0004.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0004.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0004.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0004.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0004.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0004.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0004.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0004.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0004.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0004.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0005.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0005.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0005.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0005.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0005.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0005.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0005.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0005.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0005.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0005.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0005.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0005.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0005.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0005.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0005.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0006.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0006.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0006.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0006.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0006.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0006.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0006.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0006.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0006.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0006.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0006.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0006.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0006.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0006.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0006.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0007.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0007.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0007.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0007.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0007.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0007.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0007.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0007.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0007.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0007.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0007.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0007.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0007.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0007.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0007.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0008.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0008.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0008.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0008.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0008.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0008.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0008.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0008.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0008.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0008.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0008.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0008.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0008.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0008.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0008.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0009.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0009.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0009.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0009.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0009.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0009.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0009.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0009.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0009.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0009.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0009.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0009.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0009.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0009.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0009.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0010.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0010.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0010.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0010.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0010.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0010.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0010.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0010.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0010.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0010.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0010.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0010.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0010.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0010.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0010.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0001.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0001.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0001.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0001.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0001.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0001.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0001.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0001.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0001.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0001.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0001.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0001.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0001.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0001.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0001.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0002.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0002.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0002.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0002.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0002.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0002.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0002.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0002.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0002.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0002.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0002.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0002.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0002.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0002.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0002.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0003.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0003.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0003.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0003.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0003.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0003.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0003.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0003.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0003.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0003.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0003.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0003.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0003.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0003.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0003.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0004.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0004.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0004.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0004.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0004.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0004.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0004.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0004.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0004.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0004.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0004.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0004.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0004.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0004.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0004.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0005.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0005.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0005.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0005.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0005.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0005.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0005.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0005.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0005.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0005.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0005.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0005.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0005.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0005.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0005.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0006.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0006.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0006.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0006.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0006.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0006.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0006.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0006.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0006.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0006.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0006.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0006.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0006.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0006.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0006.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0007.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0007.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0007.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0007.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0007.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0007.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0007.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0007.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0007.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0007.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0007.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0007.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0007.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0007.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0007.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0008.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0008.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0008.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0008.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0008.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0008.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0008.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0008.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0008.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0008.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0008.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0008.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0008.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0008.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0008.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0009.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0009.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0009.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0009.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0009.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0009.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0009.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0009.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0009.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0009.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0009.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0009.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0009.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0009.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0009.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0010.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0010.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0010.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0010.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0010.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0010.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0010.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0010.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0010.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0010.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0010.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0010.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0010.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0010.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0010.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0001.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0001.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0001.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0001.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0001.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0001.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0001.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0001.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0001.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0001.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0001.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0001.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0001.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0001.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0001.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0002.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0002.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0002.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0002.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0002.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0002.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0002.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0002.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0002.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0002.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0002.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0002.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0002.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0002.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0002.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0003.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0003.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0003.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0003.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0003.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0003.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0003.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0003.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0003.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0003.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0003.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0003.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0003.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0003.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0003.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0004.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0004.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0004.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0004.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0004.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0004.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0004.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0004.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0004.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0004.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0004.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0004.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0004.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0004.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0004.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0005.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0005.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0005.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0005.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0005.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0005.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0005.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0005.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0005.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0005.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0005.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0005.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0005.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0005.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0005.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0006.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0006.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0006.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0006.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0006.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0006.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0006.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0006.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0006.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0006.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0006.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0006.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0006.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0006.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0006.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0007.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0007.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0007.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0007.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0007.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0007.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0007.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0007.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0007.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0007.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0007.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0007.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0007.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0007.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0007.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/658c141c/attachment-0008.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0008.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0008.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0008.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0008.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0008.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0008.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0008.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0008.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0008.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0008.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0008.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0008.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/e38094ee/attachment-0008.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0008.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0009.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0009.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0009.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0009.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0009.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0009.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0009.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0009.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0009.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0009.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0009.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0009.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0009.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0001.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0010.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0010.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0010.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0010.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0010.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0010.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0010.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0010.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0010.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0010.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0010.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0010.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0001.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0010.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0002.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0011.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0011.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0011.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0011.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0011.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0011.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0011.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0011.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0011.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0011.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0011.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0011.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0002.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0011.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0003.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0012.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0012.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0012.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0012.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0012.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0012.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0012.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0012.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0012.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0012.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0012.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0012.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0003.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0012.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0004.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0013.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0013.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0013.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0013.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0013.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0013.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0013.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0013.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0013.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0013.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0013.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0013.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0004.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0013.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0005.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0014.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0014.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0014.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0014.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0014.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0014.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0014.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0014.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0014.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0014.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0014.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0014.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0005.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0014.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0006.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0015.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0015.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0015.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0015.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0015.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0015.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0015.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0015.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0015.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0015.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0015.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0015.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0006.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0015.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0007.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0016.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0016.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0016.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0016.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0016.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0016.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0016.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0016.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0016.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0016.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0016.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0016.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0007.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0016.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0008.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0017.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0017.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0017.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0017.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0017.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0017.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0017.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0017.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0017.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0017.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0017.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0017.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0008.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0017.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0009.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0018.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0018.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0018.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0018.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0018.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0018.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0018.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0018.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0018.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0018.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0018.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0018.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0009.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0018.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0010.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0019.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0019.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0019.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0019.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0019.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0019.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0019.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0019.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0019.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0019.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0019.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0019.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0010.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0019.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0011.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0020.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0020.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0020.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0020.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0020.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0020.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0020.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0020.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0020.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0020.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0020.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0020.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0011.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0020.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0012.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0021.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0021.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0021.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0021.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0021.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0021.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0021.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0021.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0021.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0021.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0021.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0021.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0012.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0021.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0013.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0022.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0022.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0022.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0022.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0022.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0022.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0022.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0022.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0022.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0022.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0022.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0022.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0013.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0022.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0014.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0023.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0023.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0023.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0023.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0023.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0023.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0023.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0023.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0023.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0023.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0023.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0023.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0014.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0023.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0015.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0024.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0024.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0024.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0024.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0024.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0024.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0024.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0024.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0024.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0024.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0024.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0024.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0015.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0024.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0016.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0025.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0025.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0025.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0025.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0025.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0025.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0025.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0025.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0025.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0025.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0025.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0025.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0016.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0025.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0017.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From juanmtamayo at gmail.com Thu Apr 13 20:58:00 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Thu, 13 Apr 2006 21:58:00 -0500 Subject: [Rxtx] RXTX documentation Message-ID: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Hi, I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060413/f9439a7b/attachment-0026.html From tjarvi at qbang.org Fri Apr 14 03:28:20 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 14 Apr 2006 03:28:20 -0600 (MDT) Subject: [Rxtx] RXTX documentation In-Reply-To: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > Hi, > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, so I > was wondering if I can use the documentation in Sun's site. > > Thanks a lot > > Juan > Hi Juan Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The documentation should work. There are minor corner case differences but in general its the same. Presumably rxtx will support ComAPI 3.0 if/when its design issues are resolved. -- Trent Jarvi tjarvi at qbang.org From juanmtamayo at gmail.com Fri Apr 14 09:59:04 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 10:59:04 -0500 Subject: [Rxtx] RXTX documentation In-Reply-To: References: <8985cf7d0604131958h5a7c996an97f48fed694bd0c0@mail.gmail.com> Message-ID: <8985cf7d0604140859u15eca824sab1a502c7592d01e@mail.gmail.com> Great! thanks a lot. Juan On 4/14/06, Trent Jarvi wrote: > > On Thu, 13 Apr 2006, Juan Manuel Tamayo wrote: > > > Hi, > > > > I'm trying to find documentation for RXTX 2.1 but I couldn't find any, > so I > > was wondering if I can use the documentation in Sun's site. > > > > Thanks a lot > > > > Juan > > > > Hi Juan > > Other than the namespace, rxtx tries to follow CommAPI 2.0 from Sun. The > documentation should work. There are minor corner case differences but in > general its the same. Presumably rxtx will support ComAPI 3.0 if/when its > design issues are resolved. > > -- > 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/20060414/ac879565/attachment-0026.html From p_quynh at hotmail.com Mon Apr 17 12:19:21 2006 From: p_quynh at hotmail.com (Quynh Pham) Date: Mon, 17 Apr 2006 18:19:21 +0000 Subject: [Rxtx] RXTX Version mismatch Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060417/8a9477a1/attachment-0026.html From tjarvi at qbang.org Mon Apr 17 17:06:26 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 17 Apr 2006 17:06:26 -0600 (MDT) Subject: [Rxtx] RXTX Version mismatch In-Reply-To: References: Message-ID: On Mon, 17 Apr 2006, Quynh Pham wrote: > > I tried to install RXTX for my Java program. I am using WindowXP, i can't > find any instruction for Window online.? Can you pls. help me with it? > > Right now this is the error that I get when I compile my program: > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.0-5 > > native lib Version = RXTX-2.1-7pre16 > > com.visibleassets.finder.Finder - Error connecting to COM1 > Hi Ethan You have to figure out if you need rxtx 2.1 (package gnu.io) or rxtx (package javax.comm with CommAPI for Solaris version 2.*). If you need rxtx 2.0, find and replace RXTXcomm.jar and make sure sun's comm.jar is installed. If you need rxtx 2.1, find and replace rxtxserial.dll. You have both installed and they do not work together. You may just go through and remove them all and start fresh or start with a clean java install if all else fails. It is solvable but often confusing at first. There are also installers linked off the download page that may help. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 02:31:57 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 11:31:57 +0300 Subject: [Rxtx] Two issues. Message-ID: <4444A3FD.7040809@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/f64a51d5/attachment-0026.html From deptecnico at 1000empresas.com Tue Apr 18 04:02:13 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Tue, 18 Apr 2006 11:02:13 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx Message-ID: <1199801c662cf$5001ded0$2201a8c0@monica> Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/23cf8d0b/attachment-0026.html From tjarvi at qbang.org Tue Apr 18 05:19:07 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:19:07 -0600 (MDT) Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: <4444A3FD.7040809@smslib.org> References: <4444A3FD.7040809@smslib.org> Message-ID: On Tue, 18 Apr 2006, Thanasis Delenikas wrote: > Hello Trent, All, > > I use Java and the latest RxTx v2.1 binaries. > > Two issues for the RxTx community from me: > > 1) It seems that RxTx on Win32 shows some exceptions on *some* > installations that use virtual comm ports that connect via Bluetooth / > IrDA / USB cables. I have spotted that the exception is thrown when I > call "flush()" for the serial output stream. If I remove the "flush()" > call, then no exceptions are thrown and RxTx works smoothly. When this > solution was reported to me, I thought that with no "flush()" call I > would face problems due to data remaining in the output buffers. But it > seems that flushing is performed whether I force the "flush()" call or > not. So, I assume that if I remove the flush call, I will be ok under all > circumstances. > > If anybody has a good knowledge of the inner-workings of RxTx code, I > would appreciate a response on whether the above is correct. > > Hi Thanasis My guess with flush() at this point is that some low level vendor drivers are more complete than others. If we could start documenting what driver version/vendor gave the exceptions then I could probably look at reproducing some of these and contacting vendors. I can see why some may think returning error or worse may be the right thing to do when they do not have a UART. I would suggest putting what you do have on the rxtx wiki. http://rxtx.qbang.org. If we get a decent list of driver versions and vendors in an informitive fashion vs complaining fashion, I may be able to go to vendors and suggest fixes for their low level drivers. As an example, right now I don't know which USB dongle/driver to grab to reproduce this. USB is the highest priority for me but if we have good documentation of IrDA/BlueTooth driver problems we can contact those vendor at the same time. That would be a start towards a dialog to resolve the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Apr 18 05:28:41 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 18 Apr 2006 05:28:41 -0600 (MDT) Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: On Tue, 18 Apr 2006, Departamento T?cnico wrote: > Hi > > I've deployed several applications that use Sun's Comm API to read data > from a magnetic card reader. Lately, one of the applications started > crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried > uninstalling the VM and returning to the previous version, but the > application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read from > the card, everything goes well (no exceptions), but there is no response > from the card reader. Using hyperterminal I checked that there is no > problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw any > exceptions. > > Anyone had this problem before? Do I have to change anything else in my > code in order to get this to work? Common pitfalls? > > Any help appreciated. > First I would not assume that rxtx default values are the same as Sun's. We only implemented what was documented. So threshold, timeout, flow control, parity, stop bits, .. should be set to exactly what your device needs. Second, since your hyperterminal works with the device, can you point the hyperterminal at rxtx and reproduce the problems? I cant get a card reader but if you can reproduce the problem with hyperterminal, I could look at why it is not working. -- Trent Jarvi tjarvi at qbang.org From admin at smslib.org Tue Apr 18 06:14:29 2006 From: admin at smslib.org (Thanasis Delenikas) Date: Tue, 18 Apr 2006 15:14:29 +0300 Subject: [Rxtx] Re: flush() with virtual comm ports that connect via Bluetooth / IrDA / USB cables In-Reply-To: References: <4444A3FD.7040809@smslib.org> Message-ID: <4444D825.7040100@smslib.org> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/48110e2c/attachment-0026.html From bernatx at freemail.hu Tue Apr 18 08:40:44 2006 From: bernatx at freemail.hu (=?iso-8859-2?B?QulyY3ppIEzhc3ps8yBCZXJu4XQ=?=) Date: Tue, 18 Apr 2006 16:40:44 +0200 Subject: [Rxtx] RXTX2.1-7 and 1-wire OWAPI: hangs on quitting Message-ID: <004001c662f6$12a073e0$6801a8c0@bernat> Hi! I installed under Linux (Fedora4) JDK 1.5 and rxtx-2.1-7r2. I want to use 1-wire devices with DS9097U with Java, RXTX and OWAPI. I compiled an 1-wire example program, ReadTemp.java. It works well, shows all 1-wire temperature device's temperature but when it would have to quit, it hangs on, it goes to sleep, I have to force to quit with Ctrl+C. (I can see with "top" that the java process doesn't use any longer the CPU.) The similar problem occures with any 1-wire example program. These programs works (and quits) without problem under Windows JDK. Have anyone idea? Please help! Thanks a lot! Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/ec27530c/attachment-0026.html From brian at mbari.org Tue Apr 18 10:15:05 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 18 Apr 2006 09:15:05 -0700 Subject: [Rxtx] Switching from javax.comm to rxtx In-Reply-To: <1199801c662cf$5001ded0$2201a8c0@monica> References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org > Hi > > I've deployed several applications that use Sun's Comm API to read > data from a magnetic card reader. > Lately, one of the applications started crashing the VM, > (coincidently?) after a java update (1.5.0_06). > I tried uninstalling the VM and returning to the previous version, > but the application continues to crash when closing the serial port. > > I decided to switch to rxtx as I see that Sun no longer supports > windows. > > I changed the source code's import to gnu.io.*, and commented > javax.comm.* > > I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext > > When I execute the program and start the process that would read > from the card, everything goes well (no exceptions), but there is > no response from the card reader. Using hyperterminal I checked > that there is no problem with the card reader. > > I've tried debugging my code and found that rxtx gets the port list > correctly, just can't read from the port, but also doesn't throw > any exceptions. > > Anyone had this problem before? Do I have to change anything else > in my code in order to get this to work? Common pitfalls? > > Any help appreciated. > Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060418/e0049771/attachment-0026.html From deptecnico at 1000empresas.com Wed Apr 19 03:09:01 2006 From: deptecnico at 1000empresas.com (=?iso-8859-1?Q?Departamento_T=E9cnico?=) Date: Wed, 19 Apr 2006 10:09:01 +0100 Subject: [Rxtx] Switching from javax.comm to rxtx References: <1199801c662cf$5001ded0$2201a8c0@monica> Message-ID: <151cd01c66390$e895f520$2201a8c0@monica> Using FLOWCONTROL_RTSCTS_IN worked ! Thank you very much ----- Original Message ----- From: Brian Schlining To: RXTX Developers and Users Sent: Tuesday, April 18, 2006 5:15 PM Subject: Re: [Rxtx] Switching from javax.comm to rxtx Hi, If you are running on windows then it's likely that you need to change your flow control setting. I've attached a thread form a previous post about this below. Cheers Brian Brian Schlining Software Engineer http://www.mbari.org Hi I've deployed several applications that use Sun's Comm API to read data from a magnetic card reader. Lately, one of the applications started crashing the VM, (coincidently?) after a java update (1.5.0_06). I tried uninstalling the VM and returning to the previous version, but the application continues to crash when closing the serial port. I decided to switch to rxtx as I see that Sun no longer supports windows. I changed the source code's import to gnu.io.*, and commented javax.comm.* I copied the *.dll to /bin and the RXTXcomm.jar to /lib/ext When I execute the program and start the process that would read from the card, everything goes well (no exceptions), but there is no response from the card reader. Using hyperterminal I checked that there is no problem with the card reader. I've tried debugging my code and found that rxtx gets the port list correctly, just can't read from the port, but also doesn't throw any exceptions. Anyone had this problem before? Do I have to change anything else in my code in order to get this to work? Common pitfalls? Any help appreciated. Hi Matt The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. ------------------------------------------------------------------------------ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/d3f4f58c/attachment-0026.html From Schuweiler.Joel at mayo.edu Wed Apr 19 07:25:55 2006 From: Schuweiler.Joel at mayo.edu (Schuweiler, Joel J.) Date: Wed, 19 Apr 2006 08:25:55 -0500 Subject: [Rxtx] Looking for example code. Message-ID: <7252562D82190F49B3048A4D25D273D40143085B@excsrv40.mayo.edu> I checked the wiki and I didn't see any example code for using rxtx. I followed some of the links to projects using rxtx and they didn't say much other then they require rxtx. Rather then try to figure out what other people are doing with rxtx I thought I would see if anyone has some small demo programs they would be willing to share or perhaps even a good tutorial that goes into what it takes to use rxtx. Thanks Joel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060419/a379fecd/attachment-0026.html From jason.price at novatech.co.uk Thu Apr 20 09:45:18 2006 From: jason.price at novatech.co.uk (Jason Price) Date: Thu, 20 Apr 2006 16:45:18 +0100 Subject: [Rxtx] RI not working Message-ID: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Can anyone help? I have a small class in java that just sends a string to the serial port and looks for the Ring Indicator event. The purpose is to control a Cash Drawer, sending more that 6 chars to the drawer will cause it to open the drawer. Once opened the Drawer will send RI until it is closed. The issue I have is that its just not working. I have adapted some code from any project in which rxtx is working perfectly. I have been trying to figure this out for the past 2 days but I cannot see what is wrong. The code is as follows: import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.TooManyListenersException; import gnu.io.CommPortIdentifier; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class CashDrawer implements SerialPortEventListener { private CommPortIdentifier portID=null; private SerialPort serialPort; private OutputStream outputStream; private boolean drawerOpen=false; private InputStream inputStream; private String serialPortName="COM2"; /** * for testing the cash drawer */ public static void main(String[] args) { CashDrawer draw = new CashDrawer(); draw.open(); try { System.out.println("Pausing for 1 second..."); Thread.sleep(1000); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); draw.OpenCashDrawer(); System.out.println("Drawer Open: " + draw.isCashDrawerOpen()); } catch (Exception ex) { System.out.println("error: "+ex.toString()); } } public boolean isCashDrawerOpen() { System.out.println("Drawer Open: " + drawerOpen); return drawerOpen; } private void OpenCashDrawer() { try { drawerOpen=true; outputStream.write("opensessame".getBytes()); } catch (IOException e) { e.printStackTrace(); } } public void serialEvent(SerialPortEvent event) { String eventText="No Event!"; switch (event.getEventType()) { case SerialPortEvent.BI: eventText="BI"; break; case SerialPortEvent.OE: eventText="OE"; break; case SerialPortEvent.FE: eventText="FE"; break; case SerialPortEvent.PE: eventText="PE"; break; case SerialPortEvent.CD: eventText="CD"; break; case SerialPortEvent.CTS: eventText="CTS"; break; case SerialPortEvent.DSR: eventText="DSR"; break; case SerialPortEvent.RI: eventText="RI"; break; case SerialPortEvent.OUTPUT_BUFFER_EMPTY: eventText="Output buffer empty"; break; case SerialPortEvent.DATA_AVAILABLE: System.out.println("Data Received"); break; default: eventText="Unknown Event: " + event.getEventType(); } System.out.println(eventText); } public void open() { if(portID==null) { //attempt to open serial port //this port needs to be closed via the close meths in this case for safety Enumeration portList; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); System.out.println("Found port: " + portID.getName()); if (portID.getPortType() == CommPortIdentifier.PORT_SERIAL) if (portID.getName().equalsIgnoreCase(serialPortName)) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("CashDrawer", 2000); //set up this class to receive events and set com port params serialPort.notifyOnDataAvailable(true); serialPort.notifyOnRingIndicator(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnOutputEmpty(true); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.addEventListener(this); outputStream = serialPort.getOutputStream(); inputStream = serialPort.getInputStream(); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } catch (TooManyListenersException e) { System.out.println("Too many event Listeners!"); } catch (UnsupportedCommOperationException e) { System.out.println("Unsupported Comms Exception: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); } //found port so do look anymore break; } } } else { if(serialPort==null) { System.out.println("Opening port: " + portID.getName()); try { serialPort = (SerialPort) portID.open("JavaSerialComms", 2000); } catch (PortInUseException e) { System.out.println("Port " + portID.getName() + " in use"); } } } } } and the output I get is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port: COM1 Found port: COM2 Opening port: COM2 Output buffer empty So I know it thinks it has sent the data and I have received an event. I know there is nothing wrong with the hardware as I have written a c++ dll that will open the drawer and receive RI as epected, I can't use this however as the production machines will be a mixture of linux and winxp; therefore I need to get this working in rxtx. Thanks Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060420/fae58633/attachment-0026.html From lyon at docjava.com Thu Apr 20 11:10:11 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 20 Apr 2006 12:10:11 -0500 Subject: [Rxtx] devices In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: Hi All, Is anyone using the RXTX system to interface to sensors? I have some students who are looking to program a cell phone to monitor the EKG and dial if the person is in trouble. Interfacing sensors to the cell phone is really hard (for us). Thanks! - DL From equipoise1 at verizon.net Thu Apr 20 10:10:39 2006 From: equipoise1 at verizon.net (Bill Christens-Barry) Date: Thu, 20 Apr 2006 12:10:39 -0400 Subject: [Rxtx] learning about current version, installation, etc. Message-ID: <4447B27F.1050003@verizon.net> Hi. I lurk here and am confused about the present status of RXTX, which version is current, and how what should be installed to use RXTX on my Mac OS 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web site - where should I be looking? It might also be helpful to have a demo program that would verify that the version one installs is being used. Thanks. Bill Christens-Barry From tjarvi at qbang.org Thu Apr 20 17:17:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:17:39 -0600 (MDT) Subject: [Rxtx] learning about current version, installation, etc. In-Reply-To: <4447B27F.1050003@verizon.net> References: <4447B27F.1050003@verizon.net> Message-ID: On Thu, 20 Apr 2006, Bill Christens-Barry wrote: > Hi. I lurk here and am confused about the present status of RXTX, which > version is current, and how what should be installed to use RXTX on my Mac OS > 10.4.6 setup and on my Windows XP setup. I didn't see any guidance on the web > site - where should I be looking? It might also be helpful to have a demo > program that would verify that the version one installs is being used. > Hi Bill With rxtx you need the one RXTXcomm.jar that works on all platforms and the native library for the platform you are interested in. With the source code, there is an INSTALL doc that talks about how to install. This is also on the wiki so people may improve upon it and add questions. INSTALL: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/INSTALL Wiki: http://rxtx.qbang.org/wiki/index.php/Main_Page Current rxtx source: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip To know if you have the libraries installed right, just run an example program that comes with the source code. These are in the contrib directory. When the program runs, it will display something like the following in the command prompt window: [] $ cd rxtx-2.1-7/contrib [] $ javac SimpleRead.java java SimpleRead[] $ java SimpleRead SimpleRead.class /dev/ttyxx [] $ java SimpleRead /dev/ttyS0 Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 This shows that the current version of rxtx is properly installed and loading in an example program from contrib/ that comes with the source code. Hope that helps. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:27:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:27:25 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: On Thu, 20 Apr 2006, Jason Price wrote: > Can anyone help? > > I have a small class in java that just sends a string to the serial port and > looks for the Ring Indicator event. The purpose is to control a Cash Drawer, > sending more that 6 chars to the drawer will cause it to open the drawer. > Once opened the Drawer will send RI until it is closed. The issue I have is > that its just not working. I have adapted some code from any project in > which rxtx is working perfectly. I have been trying to figure this out for > the past 2 days but I cannot see what is wrong. > > The code is as follows: > > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > import java.util.Enumeration; > import java.util.TooManyListenersException; > import gnu.io.CommPortIdentifier; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class CashDrawer implements SerialPortEventListener { > > private CommPortIdentifier portID=null; > private SerialPort serialPort; > private OutputStream outputStream; > private boolean drawerOpen=false; > private InputStream inputStream; > private String serialPortName="COM2"; > > /** > * for testing the cash drawer > */ > public static void main(String[] args) { > CashDrawer draw = new CashDrawer(); > draw.open(); > try { > System.out.println("Pausing for 1 second..."); > Thread.sleep(1000); > > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > draw.OpenCashDrawer(); > System.out.println("Drawer Open: " + > draw.isCashDrawerOpen()); > } catch (Exception ex) { > System.out.println("error: "+ex.toString()); > } > } > > public boolean isCashDrawerOpen() { > System.out.println("Drawer Open: " + drawerOpen); > return drawerOpen; > } > > private void OpenCashDrawer() { > try { > drawerOpen=true; > outputStream.write("opensessame".getBytes()); > } catch (IOException e) { > e.printStackTrace(); > } > } > > > public void serialEvent(SerialPortEvent event) { > String eventText="No Event!"; > > switch (event.getEventType()) { > > case SerialPortEvent.BI: > eventText="BI"; > break; > > case SerialPortEvent.OE: > eventText="OE"; > break; > > case SerialPortEvent.FE: > eventText="FE"; > break; > > case SerialPortEvent.PE: > eventText="PE"; > break; > > case SerialPortEvent.CD: > eventText="CD"; > break; > > case SerialPortEvent.CTS: > eventText="CTS"; > break; > > case SerialPortEvent.DSR: > eventText="DSR"; > break; > > case SerialPortEvent.RI: > eventText="RI"; > break; > > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > eventText="Output buffer empty"; > break; > > case SerialPortEvent.DATA_AVAILABLE: > System.out.println("Data Received"); > break; > default: > eventText="Unknown Event: " + event.getEventType(); > } > > System.out.println(eventText); > } > > public void open() { > > if(portID==null) { > //attempt to open serial port > //this port needs to be closed via the close meths > in this case for safety > Enumeration portList; > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portID = (CommPortIdentifier) > portList.nextElement(); > System.out.println("Found port: " + > portID.getName()); > if (portID.getPortType() == > CommPortIdentifier.PORT_SERIAL) > if > (portID.getName().equalsIgnoreCase(serialPortName)) { > System.out.println("Opening > port: " + portID.getName()); > try { > serialPort = > (SerialPort) portID.open("CashDrawer", 2000); > > //set up this class > to receive events and set com port params > > serialPort.notifyOnDataAvailable(true); > > serialPort.notifyOnRingIndicator(true); > > serialPort.notifyOnCarrierDetect(true); > > serialPort.notifyOnOutputEmpty(true); Hi Jason You probably want serialPort.notifyOnRingIndicator(true); here. > > So I know it thinks it has sent the data and I have received an event. I > know there is nothing wrong with the hardware as I have written a c++ dll > that will open the drawer and receive RI as epected, I can't use this > however as the production machines will be a mixture of linux and winxp; > therefore I need to get this working in rxtx. > Should work. Let us know how it goes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Apr 20 17:42:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Apr 2006 17:42:57 -0600 (MDT) Subject: [Rxtx] RI not working In-Reply-To: References: <01781BBBF0456F4AB2963F3AF74B914502BB24AC@ethel2.novatech.co.uk> Message-ID: >> serialPort.notifyOnRingIndicator(true); > > > > Hi Jason > > You probably want serialPort.notifyOnRingIndicator(true); here. oops you do have it. Two questions then Does this happen in linux too? That will help isolate the problem. Which version of rxtx is this? I dont recall any changes involving RI. This is probably a very old bug. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Mon Apr 24 08:54:06 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 24 Apr 2006 10:54:06 -0400 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: Is anyone using Locks for the serial ports? The Doug Lea code appears to have made it into the concurrent package, so that we can have ReadWriteLock built into the CORE jdk1.5. The Comm API needs this type of thing, right? Of course, none of this will work under JDK1.4, which is a bit of a stinky mess. Thanks! - Doug From iamshyang at gmail.com Mon Apr 24 10:04:48 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 00:04:48 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Message-ID: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> The results of your email command are provided below. Attached is your original message. - Unprocessed: I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== - Ignored: [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 - ?????? - 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com - Done. ---------- ???? ---------- From: "Bor-Shyang, Liang" To: Rxtx-request at qbang.org Date: Mon, 24 Apr 2006 23:58:43 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD Hi, I need to use SMSLib(JSMSEngine) on my FreeBSD, so I have to install RxTx first. But when I tried to install RxTx (port or package), the system output some message and stop. (1)port ======================================================= root at David /usr/ports/comms/rxtx#make install clean ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. *** Error code 1 Stop in /usr/ports/comms/rxtx. ======================================================= (2)package (source) =========================================== (After ./configure) root at David /usr/local/tmp/rxtx-2.1-7r2#make Error expanding embedded variable. ========================================== And finally I used the binary package, put the files in some directoris, and tried to used it. But when I use SendMessage, I got the message below: =================================================================================================== [root at David /usr/local/diablo-jdk1.5.0/bin]# java SendMessage SendMessage(): Send a message. Using SMSLib API for Java v1.1 java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared object " libpthread.so.0" not found, required by "librxtxSerial.so " at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at org.smslib.CSerialDriver.open (CSerialDriver.java:70) at org.smslib.CService.connect(CService.java:198) at SendMessage.main(SendMessage.java:36) ===================================================================================================== I don't what can do for making RxTx running on my FreeBSD, can you help me? thanks a lot... PS: my environment 1.FreeBSD 6.1-RC1 (I used FreeBSD 6.0-RELEASE before and had the same problem) 2.java location : /usr/local/bin/java 3.java version : java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00) Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode) 4.uname -a FreeBSD David.cs.ccu.edu.tw 6.1-RC1 FreeBSD 6.1-RC1 #0: Mon Apr 10 17:03:22 UTC 2006 root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 5.autoconf version autoconf-2.59_2 6.automake version automake-1.9.6 7.libtool version ltmain.sh (GNU libtool) 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8.make version gmake-3.80_2 -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From tjarvi at qbang.org Mon Apr 24 18:19:18 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:19:18 -0600 (MDT) Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: > > root at David /usr/ports/comms/rxtx#make install clean > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > Have you tried compiling rxtx 2.1-7? If you give me the output on or off the list, I can probably fix the compile error easily. rxtx compies on solaris for instance. It wont be hard to fix. > java.lang.UnsatisfiedLinkError: > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > object "libpthread.so.0" not found, required by "librxtxSerial.so" libpthread is part of glibc. I guess you are using a linux compatability layer? More interesting would be getting the native bsd working again. I'm not aware of why its been marked unable to compile. Thats not from rxtx. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 24 18:27:39 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 24 Apr 2006 18:27:39 -0600 (MDT) Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: References: Message-ID: On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > Is anyone using Locks for the serial ports? > The Doug Lea code appears to have made it into > the concurrent package, so that we can have ReadWriteLock > built into the CORE jdk1.5. > > The Comm API needs this type of thing, right? > > Of course, none of this will work under JDK1.4, which is > a bit of a stinky mess. > > Thanks! > - Doug > Hi Doug I tried to push lockfiles because its the right thing to do for standards like the FHS. I still think rxtx should use lockfiles and if the fight is to be had it should be done in the standards. But many companies ship rxtx with locks disabled. It is a mess and wasn't thought out in advance. Do you have an idea? I need to read about ReadWriteLock. As you mention this is a big mess with versions even if done right. -- Trent Jarvi tjarvi at qbang.org From iamshyang at gmail.com Mon Apr 24 20:57:08 2006 From: iamshyang at gmail.com (Bor-Shyang, Liang) Date: Tue, 25 Apr 2006 10:57:08 +0800 Subject: [RxTx]I need help to install/use RxTx on FreeBSD In-Reply-To: References: <152f8d5c0604240904m3fa561c2uc28802b09c61d897@mail.gmail.com> Message-ID: <152f8d5c0604241957k1308560ap9c200ff6dee43d5f@mail.gmail.com> Hi, I tried to get ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7.zip and ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip unzip and ./configure but after I made the source, the output was return: ==================================== root at David /usr/local/tmp/rxtx-2.1-7#make Error expanding embedded variable. ==================================== And I couldn't continue the process. thanks... 2006/4/25, Trent Jarvi : > > > > root at David /usr/ports/comms/rxtx#make install clean > > > > ===> rxtx-diablo-jdk15-2.1.7p17 is marked as broken: Does not compile. > > > > Have you tried compiling rxtx 2.1-7? If you give me the output on or > off the list, I can probably fix the compile error easily. rxtx compies > on solaris for instance. It wont be hard to fix. > > > java.lang.UnsatisfiedLinkError: > > /usr/local/diablo-jdk1.5.0/jre/lib/i386/librxtxSerial.so: Shared > > object "libpthread.so.0" not found, required by "librxtxSerial.so" > > libpthread is part of glibc. I guess you are using a linux compatability > layer? More interesting would be getting the native bsd working again. > I'm not aware of why its been marked unable to compile. Thats not from > rxtx. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Bor-Shyang Liang National Chung Cheng University Department of Computer Science and Information Engineering High Speed Network Group Lab Email : iamshyang at exodus.cs.ccu.edu.tw Email : iamshyang at gmail.com From j.a.horsmeier at wanadoo.nl Tue Apr 25 06:22:57 2006 From: j.a.horsmeier at wanadoo.nl (Jos A. Horsmeier) Date: Tue, 25 Apr 2006 14:22:57 +0200 Subject: [Rxtx] Lock Mess Monster (a.k.a, Little Smelly) In-Reply-To: Message-ID: <028f01c66862$fe9ccb10$1801a8c0@CALVIN> > On Mon, 24 Apr 2006, Dr. Douglas Lyon wrote: > > > Is anyone using Locks for the serial ports? > > The Doug Lea code appears to have made it into > > the concurrent package, so that we can have ReadWriteLock > built into > > the CORE jdk1.5. > > > > The Comm API needs this type of thing, right? > > > > Of course, none of this will work under JDK1.4, which is > > a bit of a stinky mess. > > > > Thanks! > > - Doug > > > Hi Doug > > I tried to push lockfiles because its the right thing to do for > standards like the FHS. I still think rxtx should use > lockfiles and if > the fight is to be had it should be done in the standards. > > But many companies ship rxtx with locks disabled. > > It is a mess and wasn't thought out in advance. Do you have an idea? > I need to read about ReadWriteLock. As you mention this is > a big mess > with versions even if done right. > > -- > Trent Jarvi WHy not apply a little OO in the C part of RXTX? Define an interface like the following: extern int lock(); /* returns false if lock fails */ extern void unlock(); /* possibly called at exit */ next implement a few, small, .so files that implement different locking mechanisms (the OO jargon is 'strategies' here). Set an environment variable that tells which locking mechanism needs to be used, e.g. set LOCKING_MECHANISM macOS set LOCKING_MECHANISM file_locking etc. etc. If this environment variable is not set, pick an applicable default value, say file_locking. The core rxtx package checks this environment variable, dlopens the corresponding .so file, dlsyms for the 'lock' function and voila. Of course this simple interface can be pooped up with additional functionality of course. kind regards, Jos From Scott.Hughes at dalsemi.com Thu Apr 27 17:32:24 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 27 Apr 2006 18:32:24 -0500 Subject: [Rxtx] devices Message-ID: <1809DA15308DD51180EE00508BCF219431473EA3@misnts1.dalsemi.com> Doug, Our 1-Wire API uses RXTX to talk to 1-Wire sensors. We have temperature, humidity, and A-to-D sensors available. Devices: http://www.maxim-ic.com/1-Wire.cfm API: http://www.maxim-ic.com/products/ibutton/software/1wire/1wire_api.cfm Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Dr. Douglas Lyon > Sent: Thursday, April 20, 2006 12:10 PM > To: rxtx at qbang.org > Subject: [Rxtx] devices > > Hi All, > Is anyone using the RXTX system to interface to sensors? > I have some students who are looking to program a cell phone to > monitor the EKG and dial if the person is in trouble. > Interfacing sensors to the cell phone is really hard (for us). > > Thanks! > - DL > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From Lars.Hennig at wow-portal.com Sun Apr 9 02:44:23 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Sun, 09 Apr 2006 08:44:23 -0000 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <44366DB1.5090204@onlinehome.de> Message-ID: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060409/e54f85b3/attachment-0026.html From juanmtamayo at gmail.com Thu Apr 13 20:46:03 2006 From: juanmtamayo at gmail.com (Juan Manuel Tamayo) Date: Fri, 14 Apr 2006 02:46:03 -0000 Subject: [Rxtx] RXTX Documentation Message-ID: <8985cf7d0604131946g2ec49a54o400667b72be43c03@mail.gmail.com> Hi, Does RXTX 2.1 works as the javax.comm API? I mean, I'm trying to find documentation for RXTX but I couldn't find any, so I was wondering if I can use the documentation in Sun's site. Thanks a lot Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060414/e38094ee/attachment-0017.html From leeren.naicker at gmail.com Tue Apr 25 06:09:33 2006 From: leeren.naicker at gmail.com (Leeren) Date: Tue, 25 Apr 2006 13:09:33 +0100 Subject: [Rxtx] RXTX Message-ID: <7d2b46e50604250509o72de8bddk1e1b955a3617d8f9@mail.gmail.com> Hi there, I am trying to access a datacard I have using RXTX and the CommApi. During runtime I get this error Exception in thread "main" java.langUnsatisfiedLinkError: no rxtxSerial in java.library.path ...... ...... ...... ...... Any help on how to solve this problem would be immensely appreciated. Thanks Leeren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060425/bb71b9c5/attachment-0026.html From bob.worsley at hp.com Thu Apr 27 17:56:02 2006 From: bob.worsley at hp.com (Worsley, Bob (Development Engineer)) Date: Thu, 27 Apr 2006 16:56:02 -0700 Subject: [Rxtx] How to read from RxTx parallel port in Win XP Message-ID: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> I'm sorry if this is a dumb question, but I didn't find the answer in the archives. I'm using the RxTx binaries for Windows on a reasonably current notebook PC running Windows XP. I can send stuff to a printer on the parallel port (LPT1), but I can't get anything back. I wrote a class that has the methods listed below. I write some data to the printer with the "write" method and then try to read a response using the "read" method, but I never get any data. I'd greatly appreciate any help you can give! Bob Worsley bobwoyid2 at yahoo.com private ParallelPort parallelPort = null; private RXTXCommDriver parallelPortDriver = null; public boolean initialize() throws IOException { if (parallelPort != null) { return false; // Already initialized } // Create the parallel port; parallelPortDriver = new RXTXCommDriver(); parallelPort = (ParallelPort)parallelPortDriver.getCommPort(address, CommPortIdentifier.PORT_PARALLEL); // Set the parallel port parameters. try { parallelPort.enableReceiveTimeout(READ_TIMEOUT); parallelPort.disableReceiveFraming(); parallelPort.disableReceiveThreshold(); //parallelPort.setMode(mode); !!!!errors } catch (UnsupportedCommOperationException e) { throw (new IOException("Parallel port with address '" + address + "' cannot be configured as specified")); } return true; } public void write(final byte[] bytes) throws IOException { initialize(); while (busyReading) { Thread.yield(); } busyWriting = true; if (bytes.length < 1) { return; } OutputStream outputStream = parallelPort.getOutputStream(); outputStream.write(bytes); outputStream.flush(); outputStream.close(); Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); busyWriting = false; } public byte[] read() throws IOException { // Read up to MAX_BYTES bytes. initialize(); while (busyWriting) { Thread.yield(); } busyReading = true; byte[] buff = new byte[MAX_BYTES_READ]; InputStream inputStream = parallelPort.getInputStream(); // This read blocks until input data is available int bytesRead = inputStream.read(buff); inputStream.close(); // If no data read, create empty array if (bytesRead == -1) { bytesRead = 0; } byte[] deviceBytes = new byte[bytesRead]; System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); if (bytesRead > 0) { Debug.p("PPIOP.read - got data: '" + new String(deviceBytes) + "'"); } busyReading = false; return deviceBytes; } From mazharmoinuddinm at danlawinc.com Tue Apr 4 02:58:00 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Tue, 4 Apr 2006 14:28:00 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604041428.01116.mazharmoinuddinm@danlawinc.com> hi, I have downloaded source code for rxtx-2.1-7r2 from the site and trying to cross compile it for arm. I have already built the kaffe for arm. The configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get the following error. throw new gnu.io.PortInUseException( ^^ *** Semantic Error: You need to modify your classpath, sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" in: /home/mazhar/kaffe-arm/jre/lib/glibj.zip /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar . /home/mazhar/rxtx-2.1-7r2 /home/mazhar/rxtx-2.1-7r2/src /home/mazhar/kaffe-arm//lib/classes.zip /home/mazhar/kaffe-arm//lib/RXTXcomm.jar any help in this regard is appreciated.. regards Mazhar From tjarvi at qbang.org Tue Apr 4 19:22:44 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 4 Apr 2006 19:22:44 -0600 (MDT) Subject: [Rxtx] help reg. ..error: gnu.io package not found In-Reply-To: <200604041428.01116.mazharmoinuddinm@danlawinc.com> References: <200604041428.01116.mazharmoinuddinm@danlawinc.com> Message-ID: On Tue, 4 Apr 2006, Mohd Mazhar Moinuddin wrote: > hi, > I have downloaded source code for rxtx-2.1-7r2 from the site and trying to > cross compile it for arm. I have already built the kaffe for arm. The > configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get > the following error. > > throw new gnu.io.PortInUseException( > ^^ > *** Semantic Error: You need to modify your classpath, sourcepath, > bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" > in: > /home/mazhar/kaffe-arm/jre/lib/glibj.zip > /home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar > . > /home/mazhar/rxtx-2.1-7r2 > /home/mazhar/rxtx-2.1-7r2/src > /home/mazhar/kaffe-arm//lib/classes.zip > /home/mazhar/kaffe-arm//lib/RXTXcomm.jar > > > any help in this regard is appreciated.. > package gnu.io is on RXTXcomm.jar try jar -tf RXTXcomm.jar and you should see gnu/io/PortInUseExecption.class Perhaps you need to modify your classpath? -- Trent Jarvi tjarvi at qbang.org From d.herwald at onlinehome.de Thu Apr 6 15:19:55 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Thu, 06 Apr 2006 23:19:55 +0200 Subject: [Rxtx] USB Serialport - disconnection problems Message-ID: <443585FB.600@onlinehome.de> Hello! First of all: RXTX is a GREAT project! It works great for all my projects! Except for one issue... I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to serial convertors (FTDI FT232) with a Java Application. (Java 1.5.0_04) A usual serial port is not removeable from the PC of course, but a USB convertor like the FT232 can be disconnected at any time! And this is the Problem: When the FT232 is disconnected while the port is open, I get lots of Exceptions. Here the code excerpt where the exceptions are thrown: --------------------------------------------------------------------------------- public class RXTXComport extends Comport implements SerialPortEventListener { //... public void serialEvent(SerialPortEvent se) { int newData = 0; switch (se.getEventType()) { //... case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); if (newData != -1) for(ComportListener listener : listeners) listener.charDataReady((char) newData); } catch (Exception e) { Global.syslog.logException(e, "Comport read error! Disconnected from target!"); Global.syslog.saveToLogFile(); } } break; } } //... } --------------------------------------------------------------------------------- These are the exceptions I get: --------------------------------------------------------------------------------- java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) java.io.IOException: No error in readByte at gnu.io.RXTXPort.readByte(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- ... goes on and on. If I close the port in the exception handling I get only one of the above exceptions followed by this one: --------------------------------------------------------------------------------- java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) at de.dsh.io.Comport.flush(Comport.java:144) at de.dsh.io.RXTXComport.close(RXTXComport.java:170) at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) --------------------------------------------------------------------------------- I use my own Exception logger that logs every exception and other messages into a file... on the standard commandline appear some messages from the native code: --------------------------------------------------------------------------------- Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): Zugriff verweigert Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. --------------------------------------------------------------------------------- "Zugriff verweigert" = German for "Access denied" I cannot open any other port after this and need to close the Application. Any other operation on the serial ports causes the Application to freeze, which is not that nice... Any ideas how to solve this problem or to detect when the port is disconnected (and close the port)? I would try it myself - but I am not that deep into Win/Linux C programming... I use C for microcontrollers only... Thanks in advance and Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Thu Apr 6 20:12:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 6 Apr 2006 20:12:47 -0600 (MDT) Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: <443585FB.600@onlinehome.de> References: <443585FB.600@onlinehome.de> Message-ID: On Thu, 6 Apr 2006, Dominik S. Herwald wrote: > Hello! > > First of all: RXTX is a GREAT project! > It works great for all my projects! > Except for one issue... > > I use the latest release 2.1.7-r2 on WinXP SP2 to use USB to > serial convertors (FTDI FT232) with a Java Application. > (Java 1.5.0_04) > > A usual serial port is not removeable from the PC of course, > but a USB convertor like the FT232 can be disconnected at any > time! > And this is the Problem: When the FT232 is disconnected while > the port is open, I get lots of Exceptions. > > Here the code excerpt where the exceptions are thrown: > --------------------------------------------------------------------------------- > public class RXTXComport extends Comport implements SerialPortEventListener > { > > //... > > public void serialEvent(SerialPortEvent se) > { > int newData = 0; > switch (se.getEventType()) > { > //... > case SerialPortEvent.DATA_AVAILABLE: > while (newData != -1) > { > try > { > newData = inputStream.read(); > if (newData != -1) > for(ComportListener listener : listeners) > listener.charDataReady((char) newData); > } > catch (Exception e) > { > Global.syslog.logException(e, > "Comport read error! Disconnected from > target!"); > Global.syslog.saveToLogFile(); > } > } > break; > } > } > > //... > > } > --------------------------------------------------------------------------------- > > > These are the exceptions I get: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > java.io.IOException: No error in readByte > at gnu.io.RXTXPort.readByte(Native Method) > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1250) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:222) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > ... goes on and on. > > If I close the port in the exception handling I get only one of the above > exceptions followed by this one: > > --------------------------------------------------------------------------------- > > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124) > at de.dsh.io.Comport.flush(Comport.java:144) > at de.dsh.io.RXTXComport.close(RXTXComport.java:170) > at de.dsh.io.RXTXComport.serialEvent(RXTXComport.java:244) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > --------------------------------------------------------------------------------- > > I use my own Exception logger that logs every exception and other messages > into a file... > on the standard commandline appear some messages from the > native code: > > --------------------------------------------------------------------------------- > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(2714): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(1468): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/../src/termios.c(482): > Zugriff verweigert > > > Error 0x5 at /home/bob/foo/tar/rxtx-2.1-7/build/.. > > --------------------------------------------------------------------------------- > > "Zugriff verweigert" = German for "Access denied" > > > I cannot open any other port after this and need to close the Application. > Any other operation on the serial ports causes the Application to freeze, > which > is not that nice... > > Any ideas how to solve this problem or to detect when the port is > disconnected > (and close the port)? > I would try it myself - but I am not that deep into Win/Linux C > programming... > I use C for microcontrollers only... > > Thanks in advance and > Best regards, > Dominik S. Herwald > > http://www.dsh-elektronik.de/ Hi Dominik This is going to be a problem for more and more people. I was just getting into a new position and looking at some serial bugs. It was about day three I realized the computer didnt even have a UART :) These USB serial dongles are going to be more and more common. At least some appear to work very well. Right now, all you can do is say "Don't unplug the dongle." Thats not very clean. We could perhaps through an exception when the w32 error is shown. The real solution is probably to start listening for USB events. Thats not a small task to determine if the port is actually USB off the top of my head. I wonder if there is ever a time when you would recieve permission denied that was not the result of the 'virtual' hardware going away. You should not be able to open the port otherwise. The 'no error' message is lazy programming on my part. w32 should set the errorno but did not in that case. The 'YACK()' is printing into your logs the actual w32 API error which needs to be translated into POSIX error codes. The default is 0 which is 'no error.' So there are a few questions. Where is the native code slipping out of the normal paths upon this error? This is a bug regardless of USB/UART. Is the 'permission denied' message enough to know what happened at all times? What will happen on Unix/Linux/Mac OS X? Would it be posible to listen to USB events while still using the virtual device. or.. can you connect the dots? The errorno and incorrect code paths I can look at sooner rather than later. The other issues will take more thought and testing. From mazharmoinuddinm at danlawinc.com Thu Apr 6 22:30:29 2006 From: mazharmoinuddinm at danlawinc.com (Mohd Mazhar Moinuddin) Date: Fri, 7 Apr 2006 10:00:29 +0530 Subject: [Rxtx] help reg. ..error: gnu.io package not found Message-ID: <200604071000.30236.mazharmoinuddinm@danlawinc.com> > hi, > ??????I have downloaded ?source code for rxtx-2.1-7r2 from the site and trying to >> cross compile it for arm. I have already built the kaffe for arm. The >> configure script runs okay but when i do a 'make' from the rxtx-2.1-7r2 i get >> the following error. >> >> ? ? ? ? ? ? ? ? ? throw new gnu.io.PortInUseException( >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^^ >> *** Semantic Error: You need to modify your classpath, sourcepath, >> bootclasspath, and/or extdirs setup. Jikes could not find package "gnu.io" >> in: >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm/jre/lib/glibj.zip >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/RXTXcomm.jar >> ? ? ? ? ? ? ? ?. >>? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2 >> ? ? ? ? ? ? ? ?/home/mazhar/rxtx-2.1-7r2/src >> ? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/classes.zip >>? ? ? ? ? ? ? ?/home/mazhar/kaffe-arm//lib/RXTXcomm.jar >> >> >> any help in this regard is appreciated.. >> >package gnu.io is on RXTXcomm.jar > >try jar -tf RXTXcomm.jar and you should see >gnu/io/PortInUseExecption.class > >Perhaps you need to modify your classpath? hi, thanks for the reply. The problem was that though the class path was set properly, there was a comm.jar too in the classpath that was giving the problem. Removing the commapi from sun solved the problem. thanks and regards Mazhar From chinkaiw at hotmail.com Fri Apr 7 01:58:18 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Fri, 07 Apr 2006 07:58:18 +0000 Subject: [Rxtx] How to implement com device plug and play? Message-ID: Hi all, I find a resource on http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD set to Mark Idle. I know how to set DTR and RTS, but do not know how to set TXD? And , did anyone implement com device plug and play? I want to find some example. Thanks. From d.herwald at onlinehome.de Fri Apr 7 07:48:33 2006 From: d.herwald at onlinehome.de (Dominik S. Herwald) Date: Fri, 07 Apr 2006 15:48:33 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: References: <443585FB.600@onlinehome.de> Message-ID: <44366DB1.5090204@onlinehome.de> > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ From tjarvi at qbang.org Fri Apr 7 20:29:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 7 Apr 2006 20:29:13 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Wang Chinkai wrote: > Hi all, > I find a resource on > http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 > > In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD > set to Mark Idle. > > I know how to set DTR and RTS, but do not know how to set TXD? > > And , did anyone implement com device plug and play? > I want to find some example. > Thanks. > > The only Mark in rxtx is Parity. This should be supported but I do not know if it has been confirmed. I think TXD refers to the transmit wire. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Apr 8 07:25:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 8 Apr 2006 07:25:47 -0600 (MDT) Subject: [Rxtx] How to implement com device plug and play? In-Reply-To: References: Message-ID: On Fri, 7 Apr 2006, Trent Jarvi wrote: > On Fri, 7 Apr 2006, Wang Chinkai wrote: > >> Hi all, >> I find a resource on >> http://www.osdever.net/documents/PNP-ExternalSerial-v1.00.pdf?the_id=52 >> >> In page 11, it says Initialize the COM port, with DTR ON , RTS OFF, and TXD >> set to Mark Idle. >> >> I know how to set DTR and RTS, but do not know how to set TXD? >> >> And , did anyone implement com device plug and play? >> I want to find some example. >> Thanks. >> >> > > The only Mark in rxtx is Parity. This should be supported but I do not know > if it has been confirmed. > > I think TXD refers to the transmit wire. > There are more good bits here but.. http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html#anchor1178493 >> Pin 2 - Transmitted Data (TxD) This signal is active when data is transmitted from the DTE device to the DCE device. When no data is transmitted, the signal is held in the mark condition (logic '1', negative voltage). << So that should be fine by default. While idle, the line will be "Mark" which is negative voltage. You can test that with a volt meter. Just open the port and check pin 2 vs the metal on the D connector or ground (pin 5). This all assumes a db 9 pin connector and no null (crossover of pins 2 and 3) modem cable. I've seen reports of people needing to cycle DTR/RTS type settings OFF and then ON but don't understand why yet. If it does not work right away, you may try that and let us know if its true. -- Trent Jarvi tjarvi at qbang.org From mtnvega at yahoo.com.br Sun Apr 9 21:44:57 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 10 Apr 2006 00:44:57 -0300 (ART) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= Message-ID: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Hello, I will be starting the implementation of a system where I will need to control some devices through an I?C bus. I am thinking about using the PC as a I?C bus master, so I would like to know if there is anything similar RXTX for I?C, and if yes, I would like to know more about it's performance. The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master instead of the PC. What do you think? Thank you, Luiz --------------------------------- Abra sua conta no Yahoo! Mail - 1GB de espa?o, alertas de e-mail no celular e anti-spam realmente eficaz. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060410/658c141c/attachment-0018.html From tjarvi at qbang.org Mon Apr 10 05:29:28 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 05:29:28 -0600 (MDT) Subject: [Rxtx] =?iso-8859-1?q?Serial_I=B2C?= In-Reply-To: <20060410034457.17801.qmail@web53510.mail.yahoo.com> References: <20060410034457.17801.qmail@web53510.mail.yahoo.com> Message-ID: On Mon, 10 Apr 2006, Luiz Jr wrote: > Hello, > > I will be starting the implementation of a system where I will need to > control some devices through an I?C bus. I am thinking about using the > PC as a I?C bus master, so I would like to know if there is anything > similar RXTX for I?C, and if yes, I would like to know more about it's > performance. > > The other option is to use RS-232 to communicate with a PIC microcontroller and make PIC the I?C bus master > instead of the PC. What do you think? > Hi Luiz Right now, rxtx will not work as you hope with i2c. It would be possible to start a class using rxtx for i2c but I suspect you would then want to reconsider the design when you finished. Sometimes hardware is the easier solution. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Apr 10 20:12:58 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Apr 2006 20:12:58 -0600 (MDT) Subject: [Rxtx] Re: Problem in RXTX (fwd) Message-ID: Date: Mon, 10 Apr 2006 20:04:35 -0600 (MDT) Subject: Re: Problem in RXTX > Hi Trent, > > if encountered a problem with the RXTX API (<= 2.1-7r2). When you call > removeEventListener() on a SerialPort without having one added first the > VM crashes at gnu.io.RXTXPort.readByte() (see attached vm log). > > Regards > Thanks Mike, There are a few issues in rxtx if you do not use event listeners. This one is new to me though. Filing a bug in the rxtx bugzilla will mean we get to it eventually. I'm somewhat burried in relocation/trainging/house shopping right now but will be getting to everything. -- Trent Jarvi tjarvi at qbang.org From chinkaiw at hotmail.com Mon Apr 10 22:08:51 2006 From: chinkaiw at hotmail.com (Wang Chinkai) Date: Tue, 11 Apr 2006 04:08:51 +0000 Subject: [Rxtx] How to know what device is connected? Message-ID: Hi, all I will control a computer remotely, some rs232 device will connect to it. I don't know what device will conect to the computer . So, how do I know is there a rs232 device connect to the computer , and what the device is? Thanks. From TEIXOEIRA at terra.es Tue Apr 11 01:26:40 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 09:26:40 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <26096171.1144740400357.JavaMail.root@cps5> Hi! Has RXTX been compiled with GCJ? Thanks! Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From szabo.roland at mithrandir.hu Tue Apr 11 02:04:05 2006 From: szabo.roland at mithrandir.hu (=?UTF-8?B?U3phYsOzIFJvbGFuZA==?=) Date: Tue, 11 Apr 2006 10:04:05 +0200 Subject: [Rxtx] How to know what device is connected? In-Reply-To: References: Message-ID: <443B62F5.7080401@mithrandir.hu> Hi Wang, I don't think there is any way to detect a device like with USB, or sense it's manufacturer/device type. You would need to start listening on the possible ports and wait for incoming data. Based on that you could either "understand" the data, and detect that it's one of your supported devices' protocol, or you could ignore it. I think you could detect a device plugged in (even if it does not send any data), if the device uses hardware flow control, so you could check the CLEAR_TO_SEND or DSR signal. (I've seen hardware that uses the CTS, DSR and RING_INDICATOR signals to signal it's presence). You cannot detect a device if it uses no flow control, and it doesn't start communication first. You could of course "probe" for supported devices, by initiating their protocols one by one, and see if anybody answers within a specified time frame. Basically detecting a device is not possible, you can only detect, if a connected device "speaks" your expected protocol. I just checked your previous email. If you take a look at that pdf file you referred to, what I mentioned above happens there exactly, only they define a generic protocol. You detect the device by monitoring DSR. Then there is an initialization sequence to make sure the device and the computer both support this protocoll (using appropriate signals, and defined timing), then both devices change the baud rate to a well defined value (1200 bps), where the device sends it's id. Now you know the device, and so you know it's capabilities. However, your device needs to support this protocol too! Roland Wang Chinkai wrote: > Hi, all > > I will control a computer remotely, some rs232 device will connect to > it. I don't know what device will conect to the computer . > So, how do I know is there a rs232 device connect to the computer , and > what the device is? > > Thanks. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lyon at docjava.com Tue Apr 11 05:27:40 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 06:27:40 -0500 Subject: [Rxtx] GCJ In-Reply-To: <26096171.1144740400357.JavaMail.root@cps5> References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Tue Apr 11 05:09:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Apr 2006 05:09:54 -0600 (MDT) Subject: [Rxtx] GCJ In-Reply-To: References: <26096171.1144740400357.JavaMail.root@cps5> Message-ID: Hi There is a directory in rxtx 2.1 that compiled with gcj. I did it as an experient but since then there have been improvements committed. See rxtx-2.1-7/CNI ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7/CNI/ It may need more work. I'm not sure CNI is still the prefered way with gcj. I did run some simple examples with it in the past. What would be very interesting is something like Blackbox from Sun's CommAPI done with gcj. On Tue, 11 Apr 2006, Dr. Douglas Lyon wrote: > Hi All, > I have a student that is using gcj for in his thesis. > It does solve some problems, while causing others. > Is this something you need? > Thanks! > - Doug > >> Hi! >> >> Has RXTX been compiled with GCJ? >> >> Thanks! >> >> >> Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >> _______________________________________________ >> 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 TEIXOEIRA at terra.es Tue Apr 11 08:52:03 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 16:52:03 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <4066946.1144767123835.JavaMail.root@cps8> Well, I was searching for a java api that let me access a serial port both on windows (sun's comm api is no longer available, as far as I know) and linux, and it would be a very desirable feature that it could be compiled with gcj, I want to develope a fast, portable and small aplication that runs both on embedded wxp and linux. I don't need the binaries to be portable, but the source code. I know there exist a part of the api that's not portable at all but I can cope with it as long as I can replace it. It seems it can be done with rxtx, doesn't it? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 13:27 Para: Asunto: Re: [Rxtx] GCJ Hi All, I have a student that is using gcj for in his thesis. It does solve some problems, while causing others. Is this something you need? Thanks! - Doug >Hi! > >Has RXTX been compiled with GCJ? > >Thanks! > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >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 Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. From lyon at docjava.com Tue Apr 11 10:11:59 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 11 Apr 2006 11:11:59 -0500 Subject: [Rxtx] GCJ In-Reply-To: <4066946.1144767123835.JavaMail.root@cps8> References: <4066946.1144767123835.JavaMail.root@cps8> Message-ID: Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as I can replace it. > > It seems it can be done with rxtx, doesn't it? > > >----Mensaje original---- >De: lyon at docjava.com >Recibido: 11/04/2006 13:27 >Para: >Asunto: Re: [Rxtx] GCJ > >Hi All, >I have a student that is using gcj for in his thesis. >It does solve some problems, while causing others. >Is this something you need? >Thanks! > - Doug > >>Hi! >> >>Has RXTX been compiled with GCJ? >> >>Thanks! >> >> >>Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. >> >> >>_______________________________________________ >>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 > > > > > >Prueba el Nuevo Correo Terra; Seguro, R?pido, Fiable. > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From TEIXOEIRA at terra.es Tue Apr 11 09:53:34 2006 From: TEIXOEIRA at terra.es (TEIXOEIRA@terra.es) Date: Tue, 11 Apr 2006 17:53:34 +0200 (MEST) Subject: [Rxtx] GCJ Message-ID: <10182838.1144770814119.JavaMail.root@cps9> Hi! No, it doesn't. What about libgcj or gnu's classpath? ----Mensaje original---- De: lyon at docjava.com Recibido: 11/04/2006 18:11 Para: Asunto: Re: [Rxtx] GCJ Hi All, As far as I know, gcj does not support jdk1.5. Thus, gcj is fast, but less compatible. - DL > Well, I was searching for a java api that let >me access a serial port both on windows (sun's >comm api is no longer available, as far as I >know) and linux, and it would be a very >desirable feature that it could be compiled with >gcj, I want to develope a fast, portable and >small >aplication that runs both on embedded wxp and >linux. I don't need the binaries to be portable, >but the source code. I know there exist a >part of the api that's not portable at all but I >can cope with it as long as